cmake_minimum_required(VERSION 3.0.0)

project(infomation-tips VERSION 0.2.3 LANGUAGES CXX C)

include(cmake/SparkEnvConfig.cmake)         # 设置一些有关QT构建的开关
include(cmake/SparkMacrosConfig.cmake)      # 声明了一些 spark_ 开头的 macro 宏
include(cmake/SparkFindQt5Config.cmake)     # 提供了 target_link_qt5 用于目标链接 qt5 的库
include(cmake/SparkFindQt6Config.cmake)     # 提供了 target_link_qt6 用于目标链接 qt6 的库
include(cmake/SparkFindLibraries.cmake)     # 提供了基于 spark_ 宏生成的 target_link_<lib> 用于目标链接 <lib> 的库
include(cmake/SparkInstallMacros.cmake)
include(cmake/SparkMacrosExtendConfig.cmake)   


# spark_add_library_realpaths
# 基于传入的项进行构建
# 可接受的值为: 路径列表
# 可接受的值为: 路径列表+依赖库A+依赖库B
spark_add_library_realpaths(
    utils/ScreenUtils           # 一个简单的屏幕工具库
    utils/ProcInfoUtils         # 一个简单的Linux系统信息工具库
    utils/NotificationUtils     # 一个简单的基于 libnotify 的 NotificationUtils 工具库
)
target_link_notify(NotificationUtils)

# 编译主体
spark_add_executable_path(${PROJECT_NAME} src resource.qrc)
target_link_ScreenUtils(${PROJECT_NAME})
target_link_ProcInfoUtils(${PROJECT_NAME})
target_link_NotificationUtils(${PROJECT_NAME})

# 测试用例
include(test/CMakeLists.txt)

# 设置安装路径前缀
spark_install("/usr")
install(TARGETS ${PROJECT_NAME}
    DESTINATION /opt/zTools/app
)
spark_install_file(assets/infomation-tips.desktop
    /usr/share/applications
)
spark_install_file(assets/infomation.png
    /usr/share/infomation-tips
)
spark_install_changelog(debian/changelog)

include(cmake/SparkBuildGraphviz.cmake)
find_package(DebPackage PATHS ${CMAKE_SOURCE_DIR})
add_package_descript(cmake/package-deb.descript)